<jsp:useBean id="Constants" class="battleship.Constants" scope="page" />
<jsp:useBean id="Login" class="battleship.Login" scope="page" />
<jsp:useBean id="LoginInfo" class="battleship.LoginInfo" scope="page" />
<jsp:setProperty name="Login" property="*" />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>Login</title>
<link rel="stylesheet" type="text/css" href="crowsnest.css">
<body>
<% final boolean loginSuccess = Login.login(request); %>
<% if (loginSuccess || LoginInfo.loggedIn(session)) { %>
    <div>Successfully logged in as <b><%= session.getAttribute("nickname") %></b>.</div>
    <div>Click <a href="index.jsp">here</a> to return to the main page.</div>
<% } else { %>
    <form action="login.jsp" method="post">
        <input type="text" name="<%= Constants.ATTR_UID %>" id="uid">
        <input type="submit" value="Login">
    </form>
    <script type="text/javascript">
    document.getElementById('uid').focus();
    </script>
<% } %>
</body>
</html>